<template>
  <div class="dialog" v-if="state">
    <div class="content">
      <p class="message">{{ message }}</p>
      <div class="btns">
        <p class="cancel" @click="button.cancel">取消</p>
        <p class="confirm" @click="button.comfirm">确定</p>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        message: "",
        state: false,
        button: {}
      };
    },
    methods: {
      hidedialog() {
        this.state = false;
      },
    }
  };
</script>

<style scoped>
  .dialog {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
  }
  .content {
    width: 15rem;
    height: 7.5rem;
    background: #fff;
    border-radius: 0.2rem;
    overflow: hidden;
    border-radius: 0.4rem;
  }

  .message {
    font-size: 1rem;
    display: block;
    padding: 0.8rem 0.8rem 0.4rem;
    line-height: 1rem;
    display: flex;

    justify-content: center;
    flex-direction: column;
    min-height: 5rem;
    box-sizing: border-box;
    border-bottom: 0.06rem solid #ebebeb;
  }
  .btns {
    display: flex;
    width: 15rem;
    justify-content: center;

    margin: 0 auto;
  }
  .cancel {
    width: 50%;
    height: 40px;
    line-height: 40px;
    text-align: center;

    color: #333;
    border-right: 0.06rem solid #ebebeb;
  }
  .confirm {
    width: 50%;
    height: 40px;
    line-height: 40px;

    color: #d93a55;
  }
</style>
